package com.edison.demo.until;
import org.apache.commons.lang3.RandomUtils;



/**
 * @author edison
 */
public  class  ChineseAddressGenerator {

    private ChineseAddressGenerator() {
        throw new IllegalStateException("Utility class");
    }


    public static String generate() {
        return  genProvinceAndCity() + generateDetailAddress();
    }

    public static String genProvinceAndCity() {
        return ChineseAreaList.provinceCityList.get(
                RandomUtils.nextInt(0, ChineseAreaList.provinceCityList.size()));
    }

    public static String generateDetailAddress() {
        return ChineseCharUtils.genRandomLengthChineseChars(2, 3) + "路" +
                RandomUtils.nextInt(1, 8000) + "号" +
                ChineseCharUtils.genRandomLengthChineseChars(2, 3) + "小区" +
                RandomUtils.nextInt(1, 20) + "单元" +
                RandomUtils.nextInt(101, 2500) + "室";
    }





}
